import request from '@/utils/request'

// 获取菜单树，本地保存的token只适用前端路由管控，后端会向浏览器注册cookie，所以在这里不需要任何参数
export const getAssignedMenu = (params?: any) =>
  request({
    url: '/menu/assigned',
    method: 'post'
  })
// 获取完整菜单树
export const getMenu = (data?: any) =>
  request({
    url: '/menu/index',
    method: 'post'
  })
// 创建菜单
export const menuCreate = (data?: any) =>
  request({
    url: '/menu/create',
    method: 'post',
    data
  })
// 修改菜单
export const menuUpdate = (data?: any) =>
  request({
    url: '/menu/update',
    method: 'post',
    data
  })
// 删除菜单
export const menuDelete = (data?: any) =>
  request({
    url: '/menu/delete',
    method: 'post',
    data
  })
// 修改菜单顺序
export const menuMove = (data?: any) =>
  request({
    url: '/menu/move',
    method: 'post',
    data
  })
